package com.xh.bussiness.tiku.service;



import com.xh.bussiness.tiku.bean.dto.KnowledgeDto;
import com.xh.bussiness.tiku.bean.request.KnowledgeRequest;
import com.xh.bussiness.tiku.bean.request.SaveKnowledgeRequest;
import com.xh.bussiness.tiku.model.Knowledge;
import com.xh.core.service.IBaseService;
import com.xh.core.bean.XhPage;

import java.util.List;

/**
 * <p>
 * 知识点信息表 服务类
 * </p>
 *
 * @author daiwei
 * @since 2019-01-14
 */
public interface IKnowledgeService extends IBaseService<Knowledge> {

    /**
     * 分页查询方法
     * @param page
     * @param bean
     * @return
     */
    public XhPage queryKnowledgePage(XhPage page, KnowledgeRequest bean);

    /**
     * 查询方法
     * @param bean
     * @return
     */
    public List queryKnowledge(KnowledgeRequest bean);
    /**
     * 查询知识点树形结构
     * @param request
     * @return
     */
	public List<KnowledgeDto> queryTree(KnowledgeRequest request);

	public List<KnowledgeDto> getRoots(List<KnowledgeDto> result);

	public void findChilds(List<KnowledgeDto> roots, List<KnowledgeDto> result);
	/**
	 * 
	 */
	public void truncateTable();

	List<Knowledge> queryKnowledgeByChapterId(String chapterId,String chapterName);

	boolean addKnowledge(SaveKnowledgeRequest request);

	boolean batchInsertKnowledge(List<KnowledgeRequest> requests);

	void initKnowledgeSortIndex(String subject);

	boolean moveUpOrDownBookKnowledge(String knowledgeId, Integer moveType);

	void moveUpOrDownBookKnowledge(List<KnowledgeRequest> requests);

	boolean addKnowledg2(SaveKnowledgeRequest request);

}
